CS424 Assignment 2

Due 8 February 2007.
  1. The simple class example S includes the comment # = data would be a mistake. Demonstrate that this would, in fact, be a mistake and explain what is going on (this is somewhat subtle in the case of the null constructor S()).
  2. Write a class for a sudoku board. The constructor will take an ASCII representation of a board:
    6--42-719
    84----3-2
    -9--7---4
    -2--8-635
    -8--124--
    -39------
    2--6-1-48
    ----49---
    ---------
    
    Include a __str__ method to create a string representation similar to the above.

    Include a scanBoard method that implements the rule “A cell has got to have a number.” Grad students: also implement the rule “A number has got to have a cell.” scanBoard should iterate until no new information is found.

  3. Undergrads: modify the menu utility to i) access more dining halls, ii) replace the hard-coded suggested date with the current date in the correct format, iii) highlight chocolate and pizza. Hints: i&ii) You will probably want to have a look at the XML in the file “menu.glade” and perhaps learn how to use glade-2, and you will probably also need to make use of the “view page source” action of most browsers.

    Grads: Using the menu utility as a base, create a utility to search the python module list (http://docs.python.org/modindex.html) for all module names that include a user specified string.

    For this problem you will need the gtk module and you may want to use glade-2. Both are available on the zoo and can be (more or less) easily installed on your own linux box if you so choose. You will also need the files with the sample driver and the GUI definition.